/*
-----------------------------------------------------------------------------
This source file is part of DIVA
The project of Engineering Lab, dept. of CSIE, NTNU.

Copyright (c) 2000-2006 The Engineering Lab, dept. of CSIE, NTNU.
-----------------------------------------------------------------------------
Filename:    xNodeType_Math.h
Description: 處理特定animation的xNodeType。
Author: hyt
		
		hyt - 09/09/27 因應WOP_Int_Proxy而作修改
-----------------------------------------------------------------------------
*/
#ifndef _H_xNodeType_Clock_H_
#define _H_xNodeType_Clock_H_

#include "xMappingNodeTypeLibrary.h"
#include "Animable.h"
#include "xNodeType.h"

class xNodeType_Clock : public xNodeType , public Animable{
	xParameterPack _xpp;
	WOP_Entry *	_wop ;
	xMappingTree _xmt;
	int* low_bound;
	int* upper_bound;
	int* increment;
	double* time_interval;
	float counter;
	float variation;
public :
	xNodeType_Clock();
	virtual void setupPorts();
	virtual string getType(){return "clock";}
	virtual void createMappedObject();
	virtual xParameter toXParameter(string type, xOutMappingPort* linked_op); 
	virtual string toMDString(MDSType) ;
	virtual int     parseMDString(vector<string>& tokens, int start_index);
	virtual bool update();
	virtual void behavior(float);
	virtual bool verify_rhs_link(xOutMappingPort *left, xInMappingPort *right, xNodeType* rightnode);
	virtual bool verify_lhs_link(xOutMappingPort *left, xNodeType* leftnode, xInMappingPort *right);
	virtual ~xNodeType_Clock();
private:
	void init_wop();
	static string valid_rhs_pair[][2];
	static string gate_pair[][2];
	static string wop_pair[][2];
	static string other_pair[][2];
};
#endif